﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Site.Models.EditModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Edit
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2>Edit</h2>

<script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>

<% using (Html.BeginForm(null, null, FormMethod.Post, new { enctype = "multipart/form-data" }))
   { %>
    <%: Html.ValidationSummary(true) %>
    <fieldset>
        <legend>Edition du profil</legend>
        
        <%: Html.HiddenFor(model => model.UserId) %>

        <table>
            <tr>
                <td>Pseudo</td>
                <td>
                    <%: Html.EditorFor(model => model.UserName) %>
                    <%: Html.ValidationMessageFor(model => model.UserName) %>
                </td>
            </tr>
            <tr>
                <td>Adresse e-mail</td>
                <td>
                    <%: Html.EditorFor(model => model.Email) %>
                    <%: Html.ValidationMessageFor(model => model.Email) %>
                </td>
            </tr>
            <tr>
                <td>Ville</td>
                <td>
                    <%: Html.EditorFor(model => model.City) %>
                    <%: Html.ValidationMessageFor(model => model.City) %>
                </td>
            </tr>
            <tr>
                <td>Pays</td>
                <td>
                    <%: Html.EditorFor(model => model.Country) %>
                    <%: Html.ValidationMessageFor(model => model.Country) %>
                </td>
            </tr>
            <tr>
                <td>Date de naissance</td>
                <td>
                    <%: Html.EditorFor(model => model.Birthday) %>
                    <%: Html.ValidationMessageFor(model => model.Birthday) %>
                </td>
            </tr>
            <tr>
                <td>Avatar</td>
                <td>
                    <%: Html.EditorFor(model => model.Avatar) %>
                    <%: Html.ValidationMessageFor(model => model.Avatar) %>
                    <br />
                    <input id="avatar_upload_file" name="avatar_upload_file" type="file" />
                </td>
            </tr>
        </table>

        <p>
            <input type="submit" value="Enregistrer" />
            <button><%: Html.ActionLink("Annuler", "details/" + Session.Contents["user_id"]) %></button>
        </p>
    </fieldset>
<% } %>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="alerts" runat="server">
</asp:Content>
